<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>自动化测试报告</title>
    <meta name="generator" content="HTMLTestRunner 0.8.2.3"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/echarts/3.8.5/echarts.common.min.js"></script>
    <!-- <script type="text/javascript" src="js/echarts.common.min.js"></script> -->
    
<style type="text/css" media="screen">
body        { font-family: Microsoft YaHei,Tahoma,arial,helvetica,sans-serif; font-size: 80%; }
table       { font-size: 100%; }
pre { white-space: pre-wrap;word-wrap: break-word; }

/* -- heading ---------------------------------------------------------------------- */
h1 {
font-size: 16pt;
color: gray;
}
.heading {
    margin-top: 0ex;
    margin-bottom: 1ex;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}

.heading .description {
    margin-top: 2ex;
    margin-bottom: 3ex;
}
/* -- css div popup ------------------------------------------------------------------------ */
a.popup_link {
}

a.popup_link:hover {
color: red;
}

.popup_window {
display: none;
position: relative;
left: 0px;
top: 0px;
/*border: solid #627173 1px; */
padding: 10px;
/* */
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
/* width: 500px;*/
}

/* -- report ------------------------------------------------------------------------ */
#total_row  { font-weight: bold; }
.passCase   { color: #5cb85c; }
.failCase   { color: #d9534f; font-weight: bold; }
.errorCase  { color: #f0ad4e; font-weight: bold; }
.hiddenRow  { display: none; }
.testcase   { margin-left: 2em; }
</style>

</head>
<body >
<script language="javascript" type="text/javascript">
output_list = Array();

/*level 调整增加只显示通过用例的分类 --Adil
0:Summary //all hiddenRow
1:Failed  //pt hiddenRow, ft none
2:Pass    //pt none, ft hiddenRow
3:Error   // pt hiddenRow, ft none
4:All     //pt none, ft none
下面设置 按钮展开逻辑  --Yang Yao Jun
*/
function showCase(level) {
    trs = document.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
        tr = trs[i];
        id = tr.id;
        if (id.substr(0,2) == 'ft') {
            if (level == 2 || level == 0 ) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
        if (id.substr(0,2) == 'pt') {
            if (level < 2 || level ==3 ) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
    }

    //加入【详细】切换文字变化 --Findyou
    detail_class=document.getElementsByClassName('detail');
    //console.log(detail_class.length)
    if (level == 3) {
        for (var i = 0; i < detail_class.length; i++){
            detail_class[i].innerHTML="收起"
            }
        }
    else{
            for (var i = 0; i < detail_class.length; i++){
            detail_class[i].innerHTML="详细"
            }
    }
}

function showClassDetail(cid, count) {
    var id_list = Array(count);
    var toHide = 1;
    for (var i = 0; i < count; i++) {
        //ID修改 点 为 下划线 -Findyou
        tid0 = 't' + cid.substr(1) + '_' + (i+1);
        tid = 'f' + tid0;
        tr = document.getElementById(tid);
        if (!tr) {
            tid = 'p' + tid0;
            tr = document.getElementById(tid);
        }
        id_list[i] = tid;
        if (tr.className) {
            toHide = 0;
        }
    }
    for (var i = 0; i < count; i++) {
        tid = id_list[i];
        //修改点击无法收起的BUG，加入【详细】切换文字变化 --Findyou
        if (toHide) {
            document.getElementById(tid).className = 'hiddenRow';
            document.getElementById(cid).innerText = "详细"
        }
        else {
            document.getElementById(tid).className = '';
            document.getElementById(cid).innerText = "收起"
        }
    }
}

function html_escape(s) {
    s = s.replace(/&/g,'&');
    s = s.replace(/</g,'<');
    s = s.replace(/>/g,'>');
    return s;
}
</script>
<div id="div_base">
<div class='heading'>
<h1 style="font-family: Microsoft YaHei">自动化测试报告</h1>
<p class='attribute'><strong>测试人员 : </strong> WangYingHao</p>
<p class='attribute'><strong>开始时间 : </strong> 2021-06-23 11:23:34</p>
<p class='attribute'><strong>合计耗时 : </strong> 0:00:27.926717</p>
<p class='attribute'><strong>测试结果 : </strong> 共 1，错误 1，通过率= 0.00%</p>

<p class='description'>2021-06-23-11:23:34</p>
</div>



    <p id='show_detail_line'>
    <a class="btn btn-primary" href='javascript:showCase(0)'>通过率 [0.00% ]</a>
    <a class="btn btn-success" href='javascript:showCase(2)'>通过[ 0 ]</a>
    <a class="btn btn-warning" href='javascript:showCase(3)'>错误[ 1 ]</a>
    <a class="btn btn-danger" href='javascript:showCase(1)'>失败[ 0 ]</a>
    <a class="btn btn-info" href='javascript:showCase(4)'>所有[ 1 ]</a>
    </p>
<table id='result_table' class="table table-condensed table-bordered table-hover">
<colgroup>
<col align='left' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
</colgroup>
<tr id='header_row' class="text-center success" style="font-weight: bold;font-size: 14px;">
    <td>用例集/测试用例</td>
    <td>总计</td>
    <td>通过</td>
    <td>错误</td>
    <td>失败</td>
    <td>详细</td>
</tr>

<tr class='errorClass warning'>
    <td>InterfaceTest</td>
    <td class="text-center">1</td>
    <td class="text-center">0</td>
    <td class="text-center">1</td>
    <td class="text-center">0</td>
    <td class="text-center"><a href="javascript:showClassDetail('c1',1)" class="detail" id='c1'>详细</a></td>
</tr>

<tr id='ft1_1' class='none'>
    <td class='errorCase'><div class='testcase'>test_run_cases_00001_1: test_run_cases_00001_1</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou
    <button id='btn_ft1_1' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_1'>错误</button>
    <div id='div_ft1_1' class="collapse">  -->

    <!-- 默认展开错误信息 -Findyou -->
    <button id='btn_ft1_1' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_1'>错误</button>
    <div id='div_ft1_1' class="collapse in" style='text-align: left; color:red;cursor:pointer'>
    <pre>
    
ft1_1: Traceback (most recent call last):
  File "D:/RayDataTestPlaformDjango/automated_main/view/ui_automation/ui_test_task/extend/run_task.py", line 85, in test_run_cases
    self.bases.click(page_element.ui_element_positioning.locating_method, page_element.ui_page_element)
  File "D:\RayDataTestPlaformDjango\automated_main\view\ui_automation\ui_test_case\ui_automation\base.py", line 122, in click
    return self.element(by, element).click()
AttributeError: 'bool' object has no attribute 'click'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python3\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python3\lib\site-packages\django\db\backends\mysql\base.py", line 73, in execute
    return self.cursor.execute(query, args)
  File "C:\Python3\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "C:\Python3\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "C:\Python3\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "C:\Python3\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1048, "Column 'ui_task_id' cannot be null")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Python3\lib\site-packages\ddt.py", line 182, in wrapper
    return func(self, *args, **kwargs)
  File "D:/RayDataTestPlaformDjango/automated_main/view/ui_automation/ui_test_task/extend/run_task.py", line 246, in test_run_cases
    UITestResultAssociated.objects.create()
  File "C:\Python3\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Python3\lib\site-packages\django\db\models\query.py", line 447, in create
    obj.save(force_insert=True, using=self.db)
  File "C:\Python3\lib\site-packages\django\db\models\base.py", line 754, in save
    force_update=force_update, update_fields=update_fields)
  File "C:\Python3\lib\site-packages\django\db\models\base.py", line 792, in save_base
    force_update, using, update_fields,
  File "C:\Python3\lib\site-packages\django\db\models\base.py", line 895, in _save_table
    results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
  File "C:\Python3\lib\site-packages\django\db\models\base.py", line 935, in _do_insert
    using=using, raw=raw,
  File "C:\Python3\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Python3\lib\site-packages\django\db\models\query.py", line 1254, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "C:\Python3\lib\site-packages\django\db\models\sql\compiler.py", line 1397, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python3\lib\site-packages\django\db\backends\utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "C:\Python3\lib\site-packages\django\db\backends\utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "C:\Python3\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python3\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Python3\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "C:\Python3\lib\site-packages\django\db\backends\mysql\base.py", line 73, in execute
    return self.cursor.execute(query, args)
  File "C:\Python3\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "C:\Python3\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "C:\Python3\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "C:\Python3\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "C:\Python3\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.IntegrityError: (1048, "Column 'ui_task_id' cannot be null")


    </pre>
    </div>
    </td>
</tr>

<tr id='total_row' class="text-center active">
    <td>总计</td>
    <td>1</td>
    <td>0</td>
    <td>1</td>
    <td>0</td>
    <td>通过率：0.00%</td>
</tr>
</table>

<div id='ending'> </div>
    <div style=" position:fixed;right:50px; bottom:30px; width:20px; height:20px;cursor:pointer">
    <a href="#"><span class="glyphicon glyphicon-eject" style = "font-size:30px;" aria-hidden="true">
    </span></a></div>
    

    <script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('chart'));

    // 指定图表的配置项和数据
    var option = {
    title : {
    text: '测试执行情况',
    x:'center'
    },
    tooltip : {
    trigger: 'item',
    formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    color: ['#95b75d', 'grey', '#b64645'],
    legend: {
    orient: 'vertical',
    left: 'left',
    data: ['通过','失败','错误']
    },
    series : [
    {
    name: '测试执行情况',
    type: 'pie',
    radius : '60%',
    center: ['50%', '60%'],
    data:[
    {value:0, name:'通过'},
    {value:0, name:'失败'},
    {value:1, name:'错误'}
    ],
    itemStyle: {
    emphasis: {
    shadowBlur: 10,
    shadowOffsetX: 0,
    shadowColor: 'rgba(0, 0, 0, 0.5)'
    }
    }
    }
    ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
    </script>
    

</body>
</html>
